IF EXISTS (SELECT * FROM SYSOBJECTS WHERE name='fnFormatoMoneda' and XTYPE='FN')
BEGIN
	DROP FUNCTION [dbo].[fnFormatoMoneda]
END
GO
CREATE FUNCTION fnFormatoMoneda
(
	@numero NUMERIC(18,2)
)
RETURNS VARCHAR(32)
WITH ENCRYPTION
AS
BEGIN
	RETURN convert(varchar(32),convert(money,@numero),1)
END
GO

